package com.acwing.partition5;

import java.io.*;

/**
 * @author `RKC`
 * @date 2022/3/22 15:40
 */
public class AC451摆花 {

    private static final int N = 110, MOD = 1000007;
    private static int[] f = new int[N];
    private static int n, m;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String[] ss = reader.readLine().split(" ");
        n = Integer.parseInt(ss[0]);
        m = Integer.parseInt(ss[1]);
        ss = reader.readLine().split(" ");
        f[0] = 1;
        for (int i = 0; i < n; i++) {
            int cnt = Integer.parseInt(ss[i]);
            for (int j = m; j >= 0; j--) {
                for (int k = 1; k <= Math.min(cnt, j); k++) {
                    f[j] = (f[j] + f[j - k]) % MOD;
                }
            }
        }
        writer.write(f[m] + "\n");
        writer.flush();
    }
}
